import React,{Component,ComponentType} from "react";

export function withLee<T>(Wrap : ComponentType<T>) : ComponentType<T> {

    return class extends Component<T> {
        render() {
            return (
                <div>
                    <Wrap {...this.props}/>
                </div>
            )
        }
    }
}

interface IProps {
    name ?: string
}

class Lee extends Component<IProps>{

    render() {
        return (
            <div>
                {this.props.name}
            </div>
        )
    }
}

export default withLee<IProps>(Lee)
